package com.wcity.manage.dao.mapper;

import com.wcity.manage.dao.dal.BaseMapper;
import com.wcity.manage.dao.model.Payment;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.io.Serializable;

/**
 * 缴费类型模块
 * Created by zm on 2016/12/12.
 */
@Repository
public interface PayTypeMapper extends BaseMapper<Payment, Serializable> {
    /**
     * 根据id查询缴费类型信息
     * @param id
     * @return
     */
    Payment getPayTypeInfo(String id);

    /**
     * 查询缴费类型是否重复
     * @param paymentType
     * @return
     */
    @Select( "select count(*) from td_payment where payment_type = #{paymentType} and user_id =#{userId}"  )
    int getPayTypeCount(@Param("paymentType") String paymentType , @Param("userId") int userId);
}
